<?php 
session_start();  
if($_SESSION['user'])
{
require_once("dbconnect.php");
$id=$_SESSION['user'];
//echo $id;
$sql="select * from executives where exe_name='$id';";
$result=mysql_query($sql);
while($row=mysql_fetch_assoc($result))
{
$name=$row['exe_name'];
//echo $name;
$id=$row['id'];
}
}
else 
{
header("Location:login.php");  
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>KK Circuits &amp; Equipments E-Reporting</title>

<link href="css/css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.6.min.js"></script>	
<script language="javascript" src="js/calendar_eu.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.17.custom.min.js"></script>	
<link rel="stylesheet" href="css/jquery-ui-1.8.17.custom.css">
<script type="text/javascript" language="javascript" src="js/jquery.dataTables.js"></script>
<link rel="stylesheet" href="css/datatable.css">
</head>
<style>
	#editor{
	width:95%;
	}
	#remarksEditor{
	width:95%;
	}
	#nextsteppopup {
	position:absolute;
  z-index:200; /* aaaalways on top*/
  padding: 3px;
 
  width: 250px;
  color: white;
	}
	.ui-dialog .ui-state-error { padding: .3em; }
	.ui-corner-all{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-weight: normal;
	color: #666666;
	text-decoration: none;
	}
	.ui-corner-all:hover{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-weight: normal;
	color: #666666;
	text-decoration: none;
	}
	.logout{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	height: 15px;
	width: 50px;
	font-weight: normal;
	color: red;
	text-decoration: none;
	}
	#bulletinDialog title{
	font-family:Arial, Helvetica, sans-serif;
	font-size:14px;
	font-weight:bold;
	}
	</style>

<script  type="text/javascript">
$(document).ready(function(){
$('.popup').live('click',function(){
var id=this.id;
//alert(id);
var $dialog = $('#bulletinDialog'+id).dialog({
                autoOpen: false,
                modal: true,
                width: 285,
                height: 230,
				
				
            });
 			/*$("#editor").attr("class", id);
			var text=$("#nst"+id).val();
			$("."+id).val(text);*/
           // $("#bulletinDialog").parent().appendTo($("form:first"));
 
            $dialog.dialog('open');
});
});

		
    </script>
<script  type="text/javascript">
$(document).ready(function(){
$('.popup2').live('click',function(){
var id=this.id;
//alert(id);
var $dialog = $('#remarksDialog'+id).dialog({
                autoOpen: false,
                modal: true,
                width: 285,
                height: 230
				
            });
 			/*$("#remarksEditor").attr("class", id);
			var text=$("#rem"+id).val();
			$("."+id).val(text);*/
           // $("#bulletinDialog").parent().appendTo($("form:first"));
 
            $dialog.dialog('open');
});
});

		
    </script>

	
    <script>

	$(function() {
		$( "#datepicker1" ).datepicker({ dateFormat: "dd-mm-yy" });
	});
	</script>
    <script>

	$(function() {
		$( "#datepicker2" ).datepicker({ dateFormat: "dd-mm-yy" });
	});
	</script>
<body>
<table width="927" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td height="116" align="left" valign="top" background="images/top-bg.jpg" style="background-repeat:repeat-x; background-position:left top"><table width="927" height="116" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="567"><img src="images/logo.jpg" width="387" height="81" /></td>
        <td width="336" align="right"><table width="300" border="0" align="right" cellpadding="0" cellspacing="0">
          <tr>
            <td class="hed">&nbsp;</td>
            <td class="hed">Executive Name </td>
            <td><span class="hed">:</span></td>
            <td>
                
                <input name="name" type="text" value="<?php echo $name;?>"  class="form-ui" placeholder="" />                          </td>
          </tr>
          <tr>
            <td width="53"  height="5"></td>
            <td width="97" height="5"></td>
            <td width="15" height="5"></td>
            <td width="135" height="5"></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td class="hed">Area</td>
            <td class="hed">:</td>
            <td><input name="area" type="text" class="form-ui" placeholder="" /></td>
          </tr>
          <tr>
            <td height="5"></td>
            <td height="5"></td>
            <td height="5"></td>
            <td height="5"></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td class="hed">Date</td>
            <td class="hed">:</td>
            <td><input name="date" type="text" class="form-ui"  id="datepicker" value="<?php echo date("d-m-Y");?>"  />                  </td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
        </table>        </td>
        <td width="24">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="600" align="left" valign="top"><table width="927" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="20">&nbsp;</td>
        <td width="643" align="right">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="48%" align="left"> <a href="user.php"><span class="logout" ><< Back</span></a></td>
              <td width="52%" align="right"><a href="logout.php"><span class="logout" >Logout</span>
          </a></td>
            </tr>
          </table>
        </td>
        <td width="20">&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td height="36" align="center" background="images/blocktopmenu.jpg" style="background-position:left top; background-repeat:repeat-x"><a href="dailyCallReportSearch.php"> <span class="links">Report Search</span></a> &nbsp; &nbsp; | &nbsp; &nbsp;<a href="enquirysearch.php">  <span class="links">Enquiry Search</span> </a>&nbsp; &nbsp;| &nbsp; &nbsp;<a href="changepassword.php"> <span class="links">Change Password</span></a> </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td align="center" valign="top" class="heading">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="20">&nbsp;</td>
        <td align="center" valign="top" class="heading">Change Password</td>
        <td width="20">&nbsp;</td>
      </tr>
      
      
      <tr>
        <td>&nbsp;</td>
        <td align="center">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="box-border">
  <tr>
    <td><div id="chngpwd">
              <form action="pwdchange.php" method="post" name="pwdform" id="pwdform">
                                            <table width="500" border="0" align="center" cellpadding="5" cellspacing="0">
                                              
                                              <tr>
                                                <td align="right" valign="top">&nbsp;</td>
                                                <td align="right" valign="top">&nbsp;</td>
                                                <td align="left">&nbsp;</td>
                                              </tr>
                                              <tr>
                                                <td align="left" valign="top">&nbsp;</td>
                                                <td align="left" valign="top" class="content">Old Password</td>
                                                <td align="left" valign="middle"><input  name="oldpwd" type="password" class="form" id="oldpwd" value="" validation="required" /></td>
                                              </tr>
                                              <tr>
                                                <td></td>
                                                <td height="5" class="content"></td>
                                                <td align="left" valign="middle"></td>
                                              </tr>
                                              <tr>
                                                <td width="85" align="left" valign="top">&nbsp;</td>
                                                <td width="198" align="left" valign="top" class="content">
                                                    New Password </td>
                                                <td width="309" align="left" valign="middle"><input name="newpwd" type="password" class="form" id="newpwd"  value="" validation="required"/></td>
                                              </tr>
                                              <tr>
                                                <td></td>
                                                <td height="5" class="content"></td>
                                                <td align="left" valign="middle"></td>
                                              </tr>
                                              <tr>
                                                <td>&nbsp;</td>
                                                <td class="content">
                                                    Confirm New Password </td>
                                                <td align="left" valign="middle"><input name="confpwd" type="password" class="form" id="confpwd" value="" validation="required" onblur="javascript:return pwdcmp();" /></td>
                                              </tr>
                                              
                                              <tr>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td align="right"><input name="changepassword" style="cursor:pointer" type="submit" class="button-right" onclick="javascript:return validat()" value="Change Password" /></td>
                                              </tr>
                                              <tr>
                                                <td>&nbsp;</td>
                                                <td>&nbsp;</td>
                                                <td align="right">&nbsp;</td>
                                              </tr>
                                            </table>
              </form>
                                      </div></td>
  </tr>
</table>
</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td align="center"><div id="dailycallresult"></div></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      
    </table></td>
  </tr>
  <tr>
    <td height="40" align="left" valign="top" bgcolor="#0B0B0B">&nbsp;</td>
  </tr>
</table>
</body>
</html>
<script type="text/javascript">
$("#ok").click(function(){

var b= $("#editor").val();
//alert(b);
var cls=$('#editor').attr('class');
//alert(cls);

var text=$('#nst'+cls).val(b);
$('#bulletinDialog').dialog('close');

//alert(text.val());
});

</script>
<script type="text/javascript">
$("#save").click(function(){

var b= $("#remarksEditor").val();
//alert(b);
var cls=$('#remarksEditor').attr('class');
//alert(cls);

var text=$('#rem'+cls).val(b);
$('#remarksDialog').dialog('close');

//alert(text.val());
});

</script>

<script type = "text/javascript">
function update() {
var counter = 0;
var tab=document.getElementById("infoTable");
var rowCount = tab.rows.length;
//alert(rowCount);
for(var i=1;i<rowCount;i++)
{
var a = $("#org"+i).val();
//alert(a);
a = a.replace(/^\s+|\s+$/g,""); // strip leading and trailing spaces
if (a!="") {counter ++;}
document.myform.count.value = counter;
}
}

</script>
<script>
function getdailycallreport(){
var frdate=$("#datepicker1").val();
var todate=$("#datepicker2").val();
var data="frmDate="+frdate+"&toDate="+todate;
$.ajax({
	url:" dailyCallReport.php",
	method: "post",
	data: data,
	cache:false,
	success: function(res){
	$("#dailycallresult").html(res);
	}
	});
}
</script>

<script type="text/javascript">
function validat()
{
	var oldpwd= $("#oldpwd").val();
 	if((oldpwd==null)||(oldpwd==''))
 		{
 		alert("please enter your old password");
 		$("#oldpwd").focus();
 		return false;
 		}
 	var newpwd= $("#newpwd").val();
	if((newpwd==null)||(newpwd==''))
	 {
 		alert("please enter your new password");
 		$("#newpwd").focus();
 		return false;
 	}
	var confpwd= $("#confpwd").val();
	if((confpwd==null)||(confpwd==''))
	 {
 		alert("please enter confirm password");
 		$("#confpwd").focus();
 		return false;
 	}
}
function pwdcmp()
{
var pwd=$("#newpwd").val();
var cnfpwd=$("#confpwd").val();
if(pwd!=cnfpwd)
	{
	alert("Your New Password And Confirm Password Must Match");
	$("#newpwd").focus();
	$("#newpwd").val('');
	$("#confpwd").val('');
	}
}
</script>